package com.dataart.productshop.service.impl;

import com.dataart.productshop.dao.*;
import com.dataart.productshop.service.BaseManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BaseManagerImpl<T> implements BaseManager<T>{


	private BaseDao<T> baseDao; //TODO: did you mean private <D extends BaseDao<T>> D dao?

    protected FileInfoDao fileInfoDao;

    protected PictureDao pictureDao;

    protected TypeDao typeDao;

    protected SubjectDao subjectDao;

    protected KathedraDao kathedraDao;

    protected StudentDao studentDao;

    protected LecturerDao lecturerDao;

    protected GpaDao gpaDao;

	public BaseManagerImpl(){
		
	}

	@Override
	public T getById(Long id) {
		return baseDao.getById(id);
	}

	@Override
	public void save(T entity) {
		baseDao.save(entity);
		
	}

	@Override
	public List<T> getAll() {
		return baseDao.getAll();
	}

	@Override
	public void delete(Long id) {
		baseDao.delete(id);
		
	}

    public BaseDao<T> getBaseDao() {
        return baseDao;
    }

    public void setBaseDao(BaseDao<T> baseDao) {
        this.baseDao = baseDao;
    }


}
